2023-07-10

Using .desktop Files for Bookmarks

Trying to use bookmarks in browsers to go to commonly visited sites is unfortunately a somewhat terrible experience. So long ago I switched to just doing that externally: Until now I just used a script that opened all these bookmarks in a menu (fuzzel, but any dmenu-like menu works for stuff like this). But as a fan of "do what I mean" features, it always annoyed me how this was yet another separate menu; Press Super+d for applications and Super+o for bookmarks. A bit primitive.

Having custom actions appear in application menus on linux is actually trivial. Just write a custom .desktop file and put it into ~/.local/share/applications/. Each bookmark in its own desktop file would be a bit excessive, but luckily the spec allows to have more than one action per .desktop file.

Here is an example:

[Desktop Entry]
Encoding=UTF-8
Name=bookmark
Comment=online bookmarks
Exec=firefox
Terminal=false
Type=Application
Icon=firefox
Actions=my-site;sourcehut;

[Desktop Action my-site]
Name=My Website
Exec=firefox https://leon_plickat.srht.site

[Desktop Action sourcehut]
Name=sourcehut
Exec=firefox "https://git.sr.ht/"

Now I can open sourcehut inside firefox comfortably from my application menu. No longer do I first have to waste a thought on whether the thing I want to open is an application or a website (and honestly some things are simply both). Nice.

This obviously also works with local files. There are a few books I use often, so I created entries for them as well, this time using xdg-open as the opener.

Having to edit .desktop files to add bookmarks is not very convenient. However the ability to open commonly used webpages and files from my application launcher is worth it for me. I know the launchers of the big desktops do something similar out of the box, but mine doesn't and this is a fine workaround in the meantime. Also I was never particularly happy with how both gnomes launcher and krunner find important files anyway, so at least for me the actual UX of my .desktop file is a tiny bit better, since it gives me direct control over what does appear in the menu and what doesn't.

I do eventually want to have an application launcher menu that allows me to insert non-application entries programmatically, but for now this is enough.

Articles from blogs I read (generated by openring)

Status update, November 2025

Hi! This month a lot of new features have added to the Goguma mobile IRC client. Hubert Hirtz has implemented drafts so that unsent text gets saved and network disconnections don’t disrupt users typing a message. He also enabled replying to one’s own messages…

emersion, November 16, 2025

the last couple years in v8's garbage collector

Let’s talk about memory management! Following up on my article about 5 years of developments in V8’s garbage collector, today I’d like to bring that up to date with what went down in V8’s GC over the last couple years.methodololologyI selected all of the …

wingolog, November 13, 2025

OpenAI employees… are you okay?

You might have seen an article making the rounds this week, about a young man who ended his life after ChatGPT encouraged him to do so. The chat logs are really upsetting. Someone two degrees removed from me took their life a few weeks ago. A close friend rel…

Drew DeVault's blog, November 8, 2025